<script type="text/ng-template" id="template-users.html">
    <h3>用户信息管理</h3>

    <div class="panel panel-default">
      <div class="panel-body">
        <form class="form-inline small form-gropu-width-sm">
          <div class="form-group">
            <label for="search-username">用户名</label>
            <input type="text" class="form-control input-sm" id="search-username" ng-model="queryStr.username">
          </div>
          <div class="form-group">
            <label for="search-realname">真实姓名</label>
            <input type="text" class="form-control input-sm" id="search-realname" ng-model="queryStr.realname">
          </div>
          <div class="form-group">
            <label for="search-cellphone">手机号</label>
            <input type="text" class="form-control input-sm" id="search-cellphone" ng-model="queryStr.phone">
          </div>
          <div class="form-group">
            <label for="search-email">邮箱</label>
            <input type="text" class="form-control input-sm" id="search-email" ng-model="queryStr.email">
          </div>

          <div class="form-group">
            <label for="exampleInputEmail2">类型</label>
            <select class="form-control input-sm" ng-model="queryStr.typeid">
                <option ng-repeat="type in userTypeList" value="{{type.id}}">{{type.name}}</option>
            </select>
          </div>

          <br>

          <div class="form-group">
            <span style="display: inline-block; width: 120px;">注册日期范围</span>
            <input type="date" class="form-control input-sm" ng-model="queryStr.rStartTime"> - 
            <input type="date" class="form-control input-sm" ng-model="queryStr.rEndTime">
          </div>

          <div class="form-group">
            <span style="display: inline-block; width: 120px;">最近登录日期范围</span>
            <input type="date" class="form-control input-sm" ng-model="queryStr.lStartTime"> - 
            <input type="date" class="form-control input-sm" ng-model="queryStr.lEndTime">
          </div>

          <div class="form-group">
            <button class="btn btn-default btn-sm" ng-click="reset()">重置查询条件</button>
            <button class="btn btn-success btn-sm" ng-click="search()"><i class="fa fa-search"></i> 搜 索 </button>
          </div>
        </form>
      </div>
    </div>

    <table class="table table-hover table-bordered table-pointer">
        <thead ng-show="userList.length>0">
            <tr>
                <th>用户ID</th>
                <th>用户名</th>
                <th>真实姓名</th>
                <th>手机号</th>
                <th>注册时间</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="item in userList" ng-click="go('/user/'+item.userid)">
                <td>{{ item.userid }}</td>
                <td>{{ item.username }}</td>
                <td>{{ item.realname }}</td>
                <td>{{ item.cellphone }}</td>
                <td>{{ item.registetime }}</td>
                <td><button class="btn btn-xs btn-danger" ng-click="deleteUser(item.userid, $event)">删除</button></td>
            </tr>
        </tbody>
    </table>

    <div class="text-center text-muted" ng-show="pagination.all==0">
      <p><i class="fa fa-frown-o" style="font-size: 4em;"></i><p>
      <p>抱歉！没有找到符合条件的记录。</p>
    </div>

    <!-- pagination -->
    <nav class="text-center">
      <ul class="pagination">
        <li ng-class="{disabled: pagination.index == 1 }">
          <a ng-click="selectPrevious()" href="javascript: void(0);" aria-label="Previous">
            <span aria-hidden="true">&laquo;</span>
          </a>
        </li>
        <li ng-repeat="page in pagination.pageArr()" ng-class="{ 'active': page == pagination.index }">
          <a href="javascript: void(0);" ng-click="pageTo(page)">{{ page }}</a>
        </li>
        <li ng-class="{disabled: pagination.index == pagination.pageCount() }">
          <a ng-click="selectNext()" href="javascript: void(0);" aria-label="Next">
            <span aria-hidden="true">&raquo;</span>
          </a>
        </li>

        <div style="display: inline-block; float: right; margin: 3px 0 0 20px;">
          每页显示：
          <select class="input-sm" ng-model="pagination.limit">
            <option ng-repeat="num in [5, 10, 15, 20]">{{num}}</option>
          </select>

          <span style="margin-left: 15px;">共 <strong>{{ pagination.all }}</strong> 条记录</span>
        </div>
      </ul>

      
    </nav>
</script>


